package org.agile2soft.nexoma.tapestry.pages.admin.users;

import org.agile2soft.nexoma.core.entities.InternalUser;
import org.apache.tapestry5.beaneditor.BeanModel;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.BeanModelSource;

import br.com.arsmachina.module.service.PrimaryKeyTypeService;
import br.com.arsmachina.tapestrycrud.base.BaseEditPage;

public class UsersEdit extends BaseEditPage<InternalUser,Integer> {

    @Inject
    private BeanModelSource beanModelSource;

    @Inject
    private PrimaryKeyTypeService primaryKeyTypeService;

    @Override
    public BeanModel<InternalUser> getBeanModel() {
        final BeanModel<InternalUser> beanModel = beanModelSource.createEditModel(getEntityClass(),
                getMessages());

        //beanModel.exclude(primaryKeyTypeService.getPrimaryKeyPropertyName(getEntityClass()));
        return beanModel;
    }

}
